<?php
Class SitemapController{
public $title; 

 
	public function __construct(){

	}

	public function IndexAction(){
		$this->layout = 'false';
		
		//$this->result = ORM::factory('razdel')->SetType('assoc')->Select('id,type,title,url')->OrderBy('title','ASC')->find_all();
		$this->result = ORM::factory()->SetType('assoc')->prepare("SELECT `type`, `title`, `url`, `mod` FROM `razdel` WHERE `sitemap`=1 ORDER BY title ASC, type DESC")->getResult();
		$this->goods = ORM::factory()->SetType('assoc')->prepare("SELECT goods.name, goods.url, goods.mod, CetegoryTovar.url as `cat`, GroupTovar.url as `group` FROM `goods`,`CetegoryTovar`, `GroupTovar` WHERE goods.Cat = CetegoryTovar.id AND CetegoryTovar.group = GroupTovar.id ORDER BY goods.name")->getResult();
		/*echo"<pre>";
		print_r($this->goods);
		echo"</pre>";*/
    }
}
